package com.qyhl.webtv.module_news.news.column;


import com.qyhl.webtv.commonlib.entity.news.UnionBean;

import java.util.List;

public class ColumnNewsListPresenter implements ColumnNewsListContract.ColumnNewsListPresenter {
    private ColumnNewsListContract.ColumnNewsListView mView;
    private ColumnNewsListModel mModel;

    ColumnNewsListPresenter(ColumnNewsListContract.ColumnNewsListView mView) {
        this.mView = mView;
        this.mModel = new ColumnNewsListModel(this);
    }

    @Override
    public void getList(String sectionId) {
        mModel.getList(sectionId);
    }

    @Override
    public void setList(List<UnionBean> beanList) {
        mView.setList(beanList);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            case 2:
                mView.setEmpty(msg);
                break;
            default:
                break;
        }
    }


}
